ShowTable of Contents
HideTable of Contents- 0.1 NotesDirectory, NotesDirectoryNavigator, LookupNames, CurrentMatch
- 0.2 LookupAllNames, CurrentMatches, FindNthMatch
- 0.3 FindFirstMatch, FindNextMatch, GetFirstItemValue, GetNextItemValue
- 0.4 FindFirstName, FindNextName, NameLocated
- 0.5 FindNthName
- 0.6 CurrentItem, GetNthItemValue
- 0.7 MatchLocated, CurrentView, CurrentName
- 0.8 GetMailInfo
- 0.9 AvailableItems
- 0.10 AvailableNames
- 0.11 AvailableView
- 0.12 GroupAuthorizationOnly
- 0.13 LimitMatches
- 0.14 PartialMatches
- 0.15 SearchAllDirectories
- 0.16 Server
- 0.17 TrustedOnly
- 0.18 UseContextServer
- 0.19 FreeLookupBuffer
- 0.20 CreateNavigator
NotesDirectory, NotesDirectoryNavigator, LookupNames, CurrentMatch
(1) This button accesses the "My Contacts" view of the personal address book in the local directory and returns the values of the "FullName" and "InternetAddress" items for each document that matches a name.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("")
End Sub
Sub Click(Source As Button)
Dim nav As NotesDirectoryNavigator
Dim msg As String
Dim value As Variant
Dim names As String
Dim items( 1 To 2) As String
items(1) = "FullName"
items(2) = "InternetAddress"
names = Inputbox$("Enter last name")
If names = "" Then Exit Sub
Set nav = directory.LookupNames("My Contacts", names, items, True)
If nav.CurrentMatches > 0 Then
Do
msg = msg & Cstr(nav.CurrentMatch) & | |
value = nav.GetFirstItemValue
msg = msg & Cstr(value(0)) & | |
value = nav.GetNextItemValue
msg = msg & Cstr(value(0)) & |
|
Loop While nav.FindNextMatch
End If
Msgbox msg,, "My Contacts"
End Sub
(2) This button accesses the "People" view of the Domino directory on a server and returns the values of the "FullName" and "InternetAddress" items for each document that matches a name.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("myserver/Acme")
End Sub
Sub Click(Source As Button)
Dim nav As NotesDirectoryNavigator
Dim msg As String
Dim value As Variant
Dim names As String
Dim items( 1 To 2) As String
items(1) = "FullName"
items(2) = "InternetAddress"
names = Inputbox$("Enter last name")
If names = "" Then Exit Sub
On Error Goto errh ' Bad server name causes exception
Set nav = directory.LookupNames("People", names, items, True)
On Error Goto 0
If nav.CurrentMatches > 0 Then
Do
msg = msg & Cstr(nav.CurrentMatch) & | |
value = nav.GetFirstItemValue
msg = msg & Cstr(value(0)) & | |
value = nav.GetNextItemValue
msg = msg & Cstr(value(0)) & |
|
Loop While nav.FindNextMatch
End If
Msgbox msg,, "People"
Exit Sub
errh:
Msgbox Error(),, Err()
Exit Sub
End Sub
LookupAllNames, CurrentMatches, FindNthMatch
This button accesses the "My Contacts" view of the personal address book in the local directory and returns the value of the "FullName" item for each document.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("")
End Sub
Sub Click(Source As Button)
Dim nav As NotesDirectoryNavigator
Dim msg As String
Dim value As Variant
Set nav = directory.LookupAllNames("My Contacts", "FullName")
For i = 1 To nav.CurrentMatches
nav.FindNthMatch(i)
value = nav.GetFirstItemValue
msg = msg & Cstr(value(0)) & |
|
Next
Msgbox msg,, "My Contacts"
End Sub
FindFirstMatch, FindNextMatch, GetFirstItemValue, GetNextItemValue
This button accesses the "My Contacts" view of the personal address book in the local directory and returns the values of the "FullName" and "InternetAddress" items for each document.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("")
End Sub
Sub Click(Source As Button)
Dim nav As NotesDirectoryNavigator
Dim msg As String
Dim value As Variant
Dim items( 1 To 2) As String
items(1) = "FullName"
items(2) = "InternetAddress"
Set nav = directory.LookupAllNames("My Contacts", items)
If nav.CurrentMatches > 0 Then
nav.FindFirstMatch 'not really needed
Do
value = nav.GetFirstItemValue
msg = msg & Cstr(value(0)) & | |
value = nav.GetNextItemValue
msg = msg & Cstr(value(0)) & |
|
Loop While nav.FindNextMatch
End If
Msgbox msg,, "My Contacts"
End Sub
FindFirstName, FindNextName, NameLocated
This button accesses the "People" view of the Domino directory on a server and returns the values of the "FullName" and "InternetAddress" items for each document that matches a name or names.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("myserver/Acme")
End Sub
Sub Click(Source As Button)
Dim nav As NotesDirectoryNavigator
Dim msg As String
Dim value As Variant
Dim names() As String
Dim nam As String
Dim pCurrentName As String
Dim n As Integer
Dim items( 1 To 2) As String
items(1) = "FullName"
items(2) = "InternetAddress"
nam = Inputbox$("Enter last name")
If nam = "" Then Exit Sub
Do
n = n + 1
Redim Preserve names(1 To n)
names(n) = nam
nam = Inputbox$("Enter another last name")
Loop While nam <> ""
On Error Goto errh ' Bad server name causes exception
Set nav = directory.LookupNames("People", names, items, True)
On Error Goto 0
Call nav.FindFirstname
While nav.CurrentName <> pCurrentName
If nav.NameLocated Then
nav.FindFirstMatch
Do
value = nav.GetFirstItemValue
msg = msg & Cstr(value(0)) & | |
value = nav.GetNextItemValue
msg = msg & Cstr(value(0)) & |
|
Loop While nav.FindNextMatch
End If
pCurrentName = nav.CurrentName
Call nav.FindNextName
Wend
Msgbox msg,, "People"
Exit Sub
errh:
Msgbox Err(),, Error()
Exit Sub
End Sub
FindNthName
This button accesses the "People" view of the Domino directory on a server and returns the values of the "FullName" and "InternetAddress" items for each document that matches a name or names.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("myserver/Acme")
End Sub
Sub Click(Source As Button)
Dim nav As NotesDirectoryNavigator
Dim msg As String
Dim value As Variant
Dim names() As String
Dim nam As String
Dim n As Integer
Dim i As Integer
Dim items( 1 To 2) As String
items(1) = "FullName"
items(2) = "InternetAddress"
nam = Inputbox$("Enter last name")
If nam = "" Then Exit Sub
Do
n = n + 1
Redim Preserve names(1 To n)
names(n) = nam
nam = Inputbox$("Enter another last name")
Loop While nam <> ""
Set nav = directory.LookupNames("People", names, items, True)
For i = 1 To Ubound(names)
If nav.FindNthName(i) > 0 Then
Do
value = nav.GetFirstItemValue
msg = msg & Cstr(value(0)) & | |
value = nav.GetNextItemValue
msg = msg & Cstr(value(0)) & |
|
Loop While nav.FindNextMatch
End If
Next
Msgbox msg,, "People"
End Sub
CurrentItem, GetNthItemValue
This button accesses the "My Contacts" view of the personal address book in the local directory and returns the values of the "FullName" and "InternetAddress" items for a name.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("")
End Sub
Sub Click(Source As Button)
Dim nav As NotesDirectoryNavigator
Dim msg As String
Dim value As Variant
Dim names As String
Dim items( 1 To 2) As String
items(1) = "FullName"
items(2) = "InternetAddress"
names = Inputbox$("Enter last name")
If names = "" Then Exit Sub
Set nav = directory.LookupNames("My Contacts", names, items, True)
If nav.MatchLocated Then
Do
msg = msg & Cstr(nav.CurrentMatch) & | |
value = nav.GetNthItemValue(1)
msg = msg & nav.CurrentItem & |=| & Cstr(value(0)) & | |
value = nav.GetNthItemValue(2)
msg = msg & nav.CurrentItem & |=| & Cstr(value(0)) & |
|
Loop While nav.FindNextMatch
Else
msg = "No matches"
End If
Msgbox msg,, "My Contacts"
End Sub
MatchLocated, CurrentView, CurrentName
This button accesses the "My Contacts" view of the personal address book in the local directory and returns the values of the "FullName" and "InternetAddress" items for a name.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("")
End Sub
Sub Click(Source As Button)
Dim nav As NotesDirectoryNavigator
Dim msg As String
Dim value As Variant
Dim names As String
Dim items( 1 To 2) As String
items(1) = "FullName"
items(2) = "InternetAddress"
names = Inputbox$("Enter last name")
If names = "" Then Exit Sub
Set nav = directory.LookupNames("My Contacts", names, items, True)
msg = "Searching " & nav.CurrentView & " for " & nav.CurrentName & |
|
If nav.MatchLocated Then
Do
msg = msg & Cstr(nav.CurrentMatch) & | |
value = nav.GetFirstItemValue
msg = msg & Cstr(value(0)) & | |
value = nav.GetNextItemValue
msg = msg & Cstr(value(0)) & |
|
Loop While nav.FindNextMatch
Else
msg = "No matches"
End If
Msgbox msg,, "My Contacts"
End Sub
GetMailInfo
This button gets the mail information for a user.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("")
End Sub
Sub Click(Source As Button)
Dim mailinfo As Variant
Dim ooo As String
Dim mailmsg As String
Dim mailname As String
mailname = Inputbox$("Name of user")
On Error Goto mailerror
mailinfo = directory.GetMailInfo(mailname, True, False)
On Error Goto 0
If mailinfo(8) = "1" Then
ooo = "Agent"
Else
ooo = "Service"
End If
mailmsg = "Mail server:" & mailinfo(0) & |
Build number: | & mailinfo(1) & |
Domino version: | & mailinfo(2) & |
Mail file: | & mailinfo(3) & |
Short name: | & mailinfo(4) & |
Mail domain: | & mailinfo(5) & |
User name | & mailinfo(6) & |
Internet mail address: | & mailinfo(7) & |
Out of office service type: | & ooo
Messagebox mailmsg,, "Mail information for " & mailname
Exit Sub
mailerror:
Messagebox Error(),, "Error number " & Err()
Exit Sub
End Sub
AvailableItems
This button gets the names of items looked up in the directory.
The form that contains this button contains other buttons that do lookups.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("")
End Sub
Sub Click(Source As Button)
Dim msg As String
If directory.AvailableItems(0) <> "" Then
Forall item In directory.AvailableItems
msg = msg & item & |
|
End Forall
Else
msg = "No lookups yet"
End If
Msgbox msg,, "Available items"
End Sub
AvailableNames
This button gets the names looked up in the directory. The form that contains this button contains other buttons that do lookups.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("")
End Sub
Sub Click(Source As Button)
Dim msg As String
If directory.AvailableNames(0) <> "" Then
Forall item In directory.AvailableNames
msg = msg & item & |
|
End Forall
Else
msg = "No names available"
End If
Msgbox msg,, "Available names"
End Sub
AvailableView
This button gets the available view. The form that contains this button contains other buttons that do lookups.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("")
End Sub
Sub Click(Source As Button)
If directory.AvailableView <> "" Then
Msgbox directory.AvailableView,, "Available view"
Else
Msgbox "No available view",, "Available view"
End If
End Sub
GroupAuthorizationOnly
This button toggles group authorization for lookups. The form that contains this button contains other buttons that do lookups.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("myserver/Acme")
End Sub
Sub Click(Source As Button)
Dim msg As String
If directory.GroupAuthorizationOnly Then
directory.GroupAuthorizationOnly = False
msg = "Search all directories"
Else
directory.GroupAuthorizationOnly = True
msg = |Search only directories marked "Enable for Group Authorization"|
End If
Msgbox msg,, "Group authorization changed"
End Sub
LimitMatches
This button toggles the limiting of matches returned for lookups. The form that contains this button contains other buttons that do lookups.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("myserver/Acme")
End Sub
Sub Click(Source As Button)
Dim msg As String
If directory.LimitMatches Then
directory.LimitMatches = False
msg = "Lookups will return all matches"
Else
directory.LimitMatches= True
msg = "Lookups will return only the first 50 matches"
End If
Msgbox msg,, "Lookup limit changed"
End Sub
PartialMatches
This button toggles the use of partial matches for lookups. The form that contains this button contains other buttons that do lookups.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("myserver/Acme")
End Sub
Sub Click(Source As Button)
Dim msg As String
If directory.PartialMatches Then
msg = "Partial matches are in effect"
Else
msg = "Partial matches are not in effect"
End If
Msgbox msg,, "Partial matches"
End Sub
SearchAllDirectories
This button toggles the searching of all directories for lookups. The form that contains this button contains other buttons that do lookups.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("myserver/Acme")
End Sub
Sub Click(Source As Button)
Dim msg As String
If directory.SearchAllDirectories Then
directory.SearchAllDirectories = False
msg = "Lookups will stop searching after the first directory with the specified view name"
Else
directory.SearchAllDirectories = True
msg = "Lookups will search all directories"
End If
Msgbox msg,, "Search all directories?"
End Sub
Server
This button displays the name of the server being used for lookups. The form that contains this button contains other buttons that do lookups.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("myserver/Acme")
End Sub
Sub Click(Source As Button)
Dim svr As String
svr = directory.Server
If svr = "" Then
svr = "Local"
End If
Msgbox svr,, "Server"
End Sub
TrustedOnly
This button toggles the searching of trusted directories for lookups. The form that contains this button contains other buttons that do lookups.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("myserver/Acme")
End Sub
Sub Click(Source As Button)
Dim msg As String
If directory.TrustedOnly Then
directory.TrustedOnly = False
msg = "Lookups will search all directories"
Else
directory.TrustedOnly= True
msg = "Lookups will search only directories containing trusted information"
End If
Msgbox msg,, "Trusted only?"
End Sub
UseContextServer
This button toggles the use of the context server for lookups. The form that contains this button contains other buttons that do lookups.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("myserver/Acme")
End Sub
Sub Click(Source As Button)
Dim msg As String
If directory.UseContextServer Then
directory.UseContextServer = False
msg = "Designated server being used"
Else
directory.UseContextServer = True
msg = "Context server being used"
End If
Msgbox msg,, "Server changed"
End Sub
FreeLookupBuffer
This button frees the lookup buffer.
The form that contains this button contains other buttons that do lookups.
Dim session As NotesSession
Dim directory As NotesDirectory
Sub Initialize
Set session = New NotesSession
Set directory = session.GetDirectory("")
End Sub
Sub Click(Source As Button)
Call directory.FreeLookupBuffer()
End Sub
CreateNavigator
No example. Does not seem to work.